<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-JAVA: awtk.Dialog类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-JAVA
   </div>
   <div id="projectbrief">AWTK JAVA API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>awtk</b></li><li class="navelem"><a class="el" href="classawtk_1_1_dialog.html">Dialog</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="classawtk_1_1_dialog-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">awtk.Dialog类 参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
类 awtk.Dialog 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classawtk_1_1_dialog.png" usemap="#awtk.Dialog_map" alt=""/>
  <map id="awtk.Dialog_map" name="awtk.Dialog_map">
<area href="classawtk_1_1_window_base.html" alt="awtk.WindowBase" shape="rect" coords="0,56,113,80"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a5dc6669cc9cb56be040664aee0f5f2f4"><td class="memItemLeft" align="right" valign="top"><a id="a5dc6669cc9cb56be040664aee0f5f2f4"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Dialog</b> (long nativeObj)</td></tr>
<tr class="separator:a5dc6669cc9cb56be040664aee0f5f2f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75ca544162ea1eb4291d7784021e2a8a"><td class="memItemLeft" align="right" valign="top">Widget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a75ca544162ea1eb4291d7784021e2a8a">getTitle</a> ()</td></tr>
<tr class="separator:a75ca544162ea1eb4291d7784021e2a8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab480c8b703e6bd59c8b4d48cc777d831"><td class="memItemLeft" align="right" valign="top">Widget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#ab480c8b703e6bd59c8b4d48cc777d831">getClient</a> ()</td></tr>
<tr class="separator:ab480c8b703e6bd59c8b4d48cc777d831"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83f730d9bb487d6321a87dc1387699bc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_ret.html">Ret</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a83f730d9bb487d6321a87dc1387699bc">setTitle</a> (String title)</td></tr>
<tr class="separator:a83f730d9bb487d6321a87dc1387699bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3be2e24cc1fff2b956349dd3fcf49de"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_dialog_quit_code.html">DialogQuitCode</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#ab3be2e24cc1fff2b956349dd3fcf49de">modal</a> ()</td></tr>
<tr class="separator:ab3be2e24cc1fff2b956349dd3fcf49de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f879dc9fc72bd3bda9a71731985f285"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_ret.html">Ret</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a8f879dc9fc72bd3bda9a71731985f285">quit</a> (int code)</td></tr>
<tr class="separator:a8f879dc9fc72bd3bda9a71731985f285"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa656f796d9157652a8b17aecce2feb0f"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#aa656f796d9157652a8b17aecce2feb0f">isQuited</a> ()</td></tr>
<tr class="separator:aa656f796d9157652a8b17aecce2feb0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addcd3d9d611bd7ab49f0152366e47621"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#addcd3d9d611bd7ab49f0152366e47621">isModal</a> ()</td></tr>
<tr class="separator:addcd3d9d611bd7ab49f0152366e47621"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a98604014aa9ffa33e7d88048eb613e82"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a98604014aa9ffa33e7d88048eb613e82">getHighlight</a> ()</td></tr>
<tr class="separator:a98604014aa9ffa33e7d88048eb613e82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classawtk_1_1_window_base"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classawtk_1_1_window_base')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="classawtk_1_1_window_base.html">awtk.WindowBase</a></td></tr>
<tr class="memitem:a07ecd7b8ff831b14e0945d0754ec2d5f inherit pub_methods_classawtk_1_1_window_base"><td class="memItemLeft" align="right" valign="top"><a id="a07ecd7b8ff831b14e0945d0754ec2d5f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>WindowBase</b> (long nativeObj)</td></tr>
<tr class="separator:a07ecd7b8ff831b14e0945d0754ec2d5f inherit pub_methods_classawtk_1_1_window_base"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18e9d39f0297072196cce80fdf08a7ee inherit pub_methods_classawtk_1_1_window_base"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_window_base.html#a18e9d39f0297072196cce80fdf08a7ee">getTheme</a> ()</td></tr>
<tr class="separator:a18e9d39f0297072196cce80fdf08a7ee inherit pub_methods_classawtk_1_1_window_base"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8065caa6c8c87501e42f0aa2888f9a9 inherit pub_methods_classawtk_1_1_window_base"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_window_closable.html">WindowClosable</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_window_base.html#aa8065caa6c8c87501e42f0aa2888f9a9">getClosable</a> ()</td></tr>
<tr class="separator:aa8065caa6c8c87501e42f0aa2888f9a9 inherit pub_methods_classawtk_1_1_window_base"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a7130fac5a05d477218a8994af0787589"><td class="memItemLeft" align="right" valign="top"><a id="a7130fac5a05d477218a8994af0787589"></a>
static <a class="el" href="classawtk_1_1_dialog.html">Dialog</a>&#160;</td><td class="memItemRight" valign="bottom"><b>cast</b> (long nativeObj)</td></tr>
<tr class="separator:a7130fac5a05d477218a8994af0787589"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f4df0384390885535613ff6c8dbb9da"><td class="memItemLeft" align="right" valign="top">static Widget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a0f4df0384390885535613ff6c8dbb9da">create</a> (Widget parent, int x, int y, int w, int h)</td></tr>
<tr class="separator:a0f4df0384390885535613ff6c8dbb9da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35acabec434ef07271ab414754a501f5"><td class="memItemLeft" align="right" valign="top">static Widget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a35acabec434ef07271ab414754a501f5">createSimple</a> (Widget parent, int x, int y, int w, int h)</td></tr>
<tr class="separator:a35acabec434ef07271ab414754a501f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8134f9a95b077960ebe171b0848e685f"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_dialog.html">Dialog</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a8134f9a95b077960ebe171b0848e685f">cast</a> (Widget widget)</td></tr>
<tr class="separator:a8134f9a95b077960ebe171b0848e685f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a36602e7b98e43ab8990000c6622ffed6"><td class="memItemLeft" align="right" valign="top">static Widget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a36602e7b98e43ab8990000c6622ffed6">open</a> (String name)</td></tr>
<tr class="separator:a36602e7b98e43ab8990000c6622ffed6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c1c8fd43660b2f62f0c12cf5a8d6083"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="enumawtk_1_1_ret.html">Ret</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a2c1c8fd43660b2f62f0c12cf5a8d6083">toast</a> (String text, int duration)</td></tr>
<tr class="separator:a2c1c8fd43660b2f62f0c12cf5a8d6083"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abeebd32c58888a117d809a1726c54510"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="enumawtk_1_1_ret.html">Ret</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#abeebd32c58888a117d809a1726c54510">info</a> (String title, String text)</td></tr>
<tr class="separator:abeebd32c58888a117d809a1726c54510"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8754ddff7e7dbc233b013534f9dc85a1"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="enumawtk_1_1_ret.html">Ret</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a8754ddff7e7dbc233b013534f9dc85a1">warn</a> (String title, String text)</td></tr>
<tr class="separator:a8754ddff7e7dbc233b013534f9dc85a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c5b5ad7521ea2f3d01ebf741d20af3f"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="enumawtk_1_1_ret.html">Ret</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_dialog.html#a5c5b5ad7521ea2f3d01ebf741d20af3f">confirm</a> (String title, String text)</td></tr>
<tr class="separator:a5c5b5ad7521ea2f3d01ebf741d20af3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_static_methods_classawtk_1_1_window_base"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classawtk_1_1_window_base')"><img src="closed.png" alt="-"/>&#160;静态 Public 成员函数 继承自 <a class="el" href="classawtk_1_1_window_base.html">awtk.WindowBase</a></td></tr>
<tr class="memitem:a98005abcb8a39d34b5b91c82370b7f1e inherit pub_static_methods_classawtk_1_1_window_base"><td class="memItemLeft" align="right" valign="top"><a id="a98005abcb8a39d34b5b91c82370b7f1e"></a>
static <a class="el" href="classawtk_1_1_window_base.html">WindowBase</a>&#160;</td><td class="memItemRight" valign="bottom"><b>cast</b> (long nativeObj)</td></tr>
<tr class="separator:a98005abcb8a39d34b5b91c82370b7f1e inherit pub_static_methods_classawtk_1_1_window_base"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afef293b79c0d92cdde82061ada03b06a inherit pub_static_methods_classawtk_1_1_window_base"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_window_base.html">WindowBase</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_window_base.html#afef293b79c0d92cdde82061ada03b06a">cast</a> (Widget widget)</td></tr>
<tr class="separator:afef293b79c0d92cdde82061ada03b06a inherit pub_static_methods_classawtk_1_1_window_base"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:a8e74dfcd388f4f9e9d13ee8a3fdcdbdf"><td class="memItemLeft" align="right" valign="top"><a id="a8e74dfcd388f4f9e9d13ee8a3fdcdbdf"></a>
long&#160;</td><td class="memItemRight" valign="bottom"><b>nativeObj</b></td></tr>
<tr class="separator:a8e74dfcd388f4f9e9d13ee8a3fdcdbdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_attribs_classawtk_1_1_window_base"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_classawtk_1_1_window_base')"><img src="closed.png" alt="-"/>&#160;Public 属性 继承自 <a class="el" href="classawtk_1_1_window_base.html">awtk.WindowBase</a></td></tr>
<tr class="memitem:a446bcc7b77e1cca7b0c2390901e0b0ac inherit pub_attribs_classawtk_1_1_window_base"><td class="memItemLeft" align="right" valign="top"><a id="a446bcc7b77e1cca7b0c2390901e0b0ac"></a>
long&#160;</td><td class="memItemRight" valign="bottom"><b>nativeObj</b></td></tr>
<tr class="separator:a446bcc7b77e1cca7b0c2390901e0b0ac inherit pub_attribs_classawtk_1_1_window_base"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>对话框。 对话框是一种特殊的窗口，大小和位置可以自由设置。</p>
<p>AWTK中的对话框可以是模态的，也可以是非模态的。</p>
<p>如果dialog有透明或半透效果则不支持窗口动画。</p>
<p>由于浏览器中无法实现主循环嵌套，因此无法实现模态对话框。 如果希望自己写的AWTK应用程序可以在浏览器(包括各种小程序)中运行或演示， 请避免使用模态对话框。</p>
<p>对话框通常由对话框标题和对话框客户区两部分组成：</p>
<p>dialog_t是window的子类控件，window_base_t的函数均适用于dialog_t控件。</p>
<p>在xml中使用"dialog"标签创建对话框。如：</p>
<div class="fragment"><div class="line">&lt;<span class="keywordtype">dialog</span> <span class="keyword">anim_hint</span>=<span class="stringliteral">&quot;center_scale(duration=300)&quot;</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;c&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;m&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;80%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;160&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;Dialog&quot;</span>&gt;</div><div class="line">&lt;<span class="keywordtype">dialog_title</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;0&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;0&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;100%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;30&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;Hello AWTK&quot;</span> /&gt;</div><div class="line">&lt;<span class="keywordtype">dialog_client</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;0&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;bottom&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;100%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;-30&quot;</span>&gt;</div><div class="line">&lt;<span class="keywordtype">label</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;&quot;</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;center&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;middle:-20&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;200&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;30&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;Are you ready?&quot;</span>/&gt;</div><div class="line">&lt;<span class="keywordtype">button</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;quit&quot;</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;10&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;bottom:10&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;40%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;30&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;确定&quot;</span>/&gt;</div><div class="line">&lt;<span class="keywordtype">button</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;quit&quot;</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;right:10&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;bottom:10&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;40%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;30&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;取消&quot;</span>/&gt;</div><div class="line">&lt;/<span class="keywordtype">dialog_client</span>&gt;</div><div class="line">&lt;/<span class="keywordtype">dialog</span>&gt;</div></div><!-- fragment --><p>如果你不需要对话框的标题，可以这样写：</p>
<div class="fragment"><div class="line">&lt;<span class="keywordtype">dialog</span> <span class="keyword">anim_hint</span>=<span class="stringliteral">&quot;center_scale(duration=300)&quot;</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;c&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;m&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;80%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;160&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;Dialog&quot;</span>&gt;</div><div class="line">&lt;<span class="keywordtype">label</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;&quot;</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;center&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;middle:-20&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;200&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;30&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;Are you ready?&quot;</span>/&gt;</div><div class="line">&lt;<span class="keywordtype">button</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;quit&quot;</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;10&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;bottom:10&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;40%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;30&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;确定&quot;</span>/&gt;</div><div class="line">&lt;<span class="keywordtype">button</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;quit&quot;</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;right:10&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;bottom:10&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;40%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;30&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;取消&quot;</span>/&gt;</div><div class="line">&lt;/<span class="keywordtype">dialog</span>&gt;</div></div><!-- fragment --><p>打开非模态对话框时，其用法与普通窗口一样。打开非模态对话框时，还需要调用dialog_modal。</p>
<p>关闭模态对话框用dialog_quit</p>
<p>关闭非模态对话框用window_close。</p>
<p>更多用法请参考： <a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/">dialog.xml</a></p>
<p>完整C代码示例请参考：</p>
<ul>
<li><a href="https://github.com/zlgopen/awtk-c-demos/blob/master/demos/dialog.c">非模态对话框</a></li>
<li><a href="https://github.com/zlgopen/awtk-c-demos/blob/master/demos/dialog_modal.c">模态对话框</a></li>
</ul>
<p>可用通过style来设置控件的显示风格，如字体的大小和颜色等等。如：</p>
<div class="fragment"><div class="line">&lt;<span class="keywordtype">style</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;default&quot;</span>&gt;</div><div class="line">&lt;<span class="keywordtype">normal</span> <span class="keyword">border_color</span>=<span class="stringliteral">&quot;#606060&quot;</span> /&gt;</div><div class="line">&lt;/<span class="keywordtype">style</span>&gt;</div></div><!-- fragment --><p>更多用法请参考： <a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml#L324">theme default</a> </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a8134f9a95b077960ebe171b0848e685f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8134f9a95b077960ebe171b0848e685f">&#9670;&nbsp;</a></span>cast()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_dialog.html">Dialog</a> awtk.Dialog.cast </td>
          <td>(</td>
          <td class="paramtype">Widget&#160;</td>
          <td class="paramname"><em>widget</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>转换dialog对象(供脚本语言使用)。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">widget</td><td>dialog对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>dialog对象。 </dd></dl>

</div>
</div>
<a id="a5c5b5ad7521ea2f3d01ebf741d20af3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c5b5ad7521ea2f3d01ebf741d20af3f">&#9670;&nbsp;</a></span>confirm()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="enumawtk_1_1_ret.html">Ret</a> awtk.Dialog.confirm </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>title</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>text</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>显示『确认』对话框。</p>
<p>主题由dialog_confirm.xml文件决定。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">title</td><td>标题。 </td></tr>
    <tr><td class="paramname">text</td><td>文本内容。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示确认，否则表示取消。 </dd></dl>

</div>
</div>
<a id="a0f4df0384390885535613ff6c8dbb9da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f4df0384390885535613ff6c8dbb9da">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Widget awtk.Dialog.create </td>
          <td>(</td>
          <td class="paramtype">Widget&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建dialog对象。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>dialog对象。 </dd></dl>

</div>
</div>
<a id="a35acabec434ef07271ab414754a501f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35acabec434ef07271ab414754a501f5">&#9670;&nbsp;</a></span>createSimple()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Widget awtk.Dialog.createSimple </td>
          <td>(</td>
          <td class="paramtype">Widget&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建dialog对象，同时创建title/client。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>dialog对象。 </dd></dl>

</div>
</div>
<a id="ab480c8b703e6bd59c8b4d48cc777d831"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab480c8b703e6bd59c8b4d48cc777d831">&#9670;&nbsp;</a></span>getClient()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Widget awtk.Dialog.getClient </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>获取client控件。</p>
<dl class="section return"><dt>返回</dt><dd>client对象。 </dd></dl>

</div>
</div>
<a id="a98604014aa9ffa33e7d88048eb613e82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a98604014aa9ffa33e7d88048eb613e82">&#9670;&nbsp;</a></span>getHighlight()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">String awtk.Dialog.getHighlight </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>对话框高亮策略。</p>
<p>请参考 https://github.com/zlgopen/awtk/blob/master/docs/dialog_highlight.md "对话框高亮策略" </p>

</div>
</div>
<a id="a75ca544162ea1eb4291d7784021e2a8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a75ca544162ea1eb4291d7784021e2a8a">&#9670;&nbsp;</a></span>getTitle()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Widget awtk.Dialog.getTitle </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>获取title控件。</p>
<dl class="section return"><dt>返回</dt><dd>title对象。 </dd></dl>

</div>
</div>
<a id="abeebd32c58888a117d809a1726c54510"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abeebd32c58888a117d809a1726c54510">&#9670;&nbsp;</a></span>info()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="enumawtk_1_1_ret.html">Ret</a> awtk.Dialog.info </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>title</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>text</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>显示『提示信息』对话框。</p>
<p>主题由dialog_info.xml文件决定。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">title</td><td>标题。 </td></tr>
    <tr><td class="paramname">text</td><td>文本内容。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="addcd3d9d611bd7ab49f0152366e47621"></a>
<h2 class="memtitle"><span class="permalink"><a href="#addcd3d9d611bd7ab49f0152366e47621">&#9670;&nbsp;</a></span>isModal()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">boolean awtk.Dialog.isModal </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>检查对话框是否为模态对话框。</p>
<dl class="section return"><dt>返回</dt><dd>返回TRUE表示是模态对话框，否则表示不是。 </dd></dl>

</div>
</div>
<a id="aa656f796d9157652a8b17aecce2feb0f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa656f796d9157652a8b17aecce2feb0f">&#9670;&nbsp;</a></span>isQuited()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">boolean awtk.Dialog.isQuited </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>检查对话框是否已经退出模态。</p>
<dl class="section return"><dt>返回</dt><dd>返回TRUE表示已经退出，否则表示没有。 </dd></dl>

</div>
</div>
<a id="ab3be2e24cc1fff2b956349dd3fcf49de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3be2e24cc1fff2b956349dd3fcf49de">&#9670;&nbsp;</a></span>modal()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_dialog_quit_code.html">DialogQuitCode</a> awtk.Dialog.modal </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>模态显示对话框。 dialog_modal返回后，dialog对象将在下一个idle函数中回收。 也就是在dialog_modal调用完成后仍然可以访问dialog中控件，直到本次事件结束。</p>
<dl class="section return"><dt>返回</dt><dd>返回退出吗。 </dd></dl>

</div>
</div>
<a id="a36602e7b98e43ab8990000c6622ffed6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36602e7b98e43ab8990000c6622ffed6">&#9670;&nbsp;</a></span>open()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static Widget awtk.Dialog.open </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>从资源文件中加载并创建Dialog对象。</p>
<p>本函数在ui_loader/ui_builder_default里实现。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>dialog的名称。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

</div>
</div>
<a id="a8f879dc9fc72bd3bda9a71731985f285"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f879dc9fc72bd3bda9a71731985f285">&#9670;&nbsp;</a></span>quit()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_ret.html">Ret</a> awtk.Dialog.quit </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>code</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>退出模态显示，关闭对话框。</p>
<p>比如，在对话框中关闭按钮的事件处理函数中，调用本函数关闭对话框。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">code</td><td>退出码，作为dialog_modal的返回值(参考：dialog_quit_code_t)。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a83f730d9bb487d6321a87dc1387699bc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a83f730d9bb487d6321a87dc1387699bc">&#9670;&nbsp;</a></span>setTitle()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_ret.html">Ret</a> awtk.Dialog.setTitle </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>title</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>设置对话框的标题文本。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">title</td><td>标题。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a2c1c8fd43660b2f62f0c12cf5a8d6083"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2c1c8fd43660b2f62f0c12cf5a8d6083">&#9670;&nbsp;</a></span>toast()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="enumawtk_1_1_ret.html">Ret</a> awtk.Dialog.toast </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>duration</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>显示『短暂提示信息』对话框。</p>
<p>主题由dialog_toast.xml文件决定。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">text</td><td>文本内容。 </td></tr>
    <tr><td class="paramname">duration</td><td>显示时间(单位为毫秒)。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a8754ddff7e7dbc233b013534f9dc85a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8754ddff7e7dbc233b013534f9dc85a1">&#9670;&nbsp;</a></span>warn()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="enumawtk_1_1_ret.html">Ret</a> awtk.Dialog.warn </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>title</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>text</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>显示『警告』对话框。</p>
<p>主题由dialog_warn.xml文件决定。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">title</td><td>标题。 </td></tr>
    <tr><td class="paramname">text</td><td>文本内容。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/Dialog.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
